var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '123456',
    database: 'school'
});

connection.connect();


var sql = "SELECT * from student";

var callBack = function (error, results, fields) {
    if (error) throw error;
    console.log('The solution is: ', results[0].name);
}

connection.query(sql, callBack);